const {
    http
} = uni.$u


// 获取文章详情
export const mpLoginByCode = (params, config = {}) => http.get('/api/wechat/mpLogin', params, {
    custom: {
        auth: true
    }
})

// 获取手机验证码
export const getCaptchaSms = (params, config = {}) => http.get('/api/captchaSms', params, {
    custom: {
        auth: false
    }
})
//获取字典
export const getDictType = (params, config = {}) => http.get('/api/houseApi/getDictType', params, {
    custom: {
        auth: true
    }
})

//房间列表
export const getRoomList = (params, config = {}) => http.get('/api/room/list', params, {
    custom: {
        auth: true
    }
})
 
//房间列表
export const getUserHouse = (params, config = {}) => http.get('/api/room/getUserHouse', params, {
    custom: {
        auth: true
    }
})
 

//查找小区列表
export const findVillageList = (params, config = {}) => http.get('/api/village/list', params, {
    custom: {
        auth: true
    }
})

//房间列表
export const findHouseById = (id, config = {}) => http.get('/api/room/'+id,{}, {
    custom: {
        auth: true
    }
})

//广告banner列表
export const getAdvertList = (params, config = {}) => http.get('/api/advert/list',params, {
    custom: {
        auth: true
    }
})
//获取分享配置参数
export const getShareConfig = (params, config = {}) => http.get('/api/wechat/shareConfig',params, {
    custom: {
        auth: true
    }
})


//收藏房源
export const saveHeart = (params, config = {}) => http.post('/api/room/saveHeart', params, {
    custom: {
        auth: true
    }
})



//手机注册
export const thirdRegister = (params, config = {}) => http.post('/api/thirdRegister', params, {
    custom: {
        auth: false
    }
})

//新增房源
export const addRoom = (params, config = {}) => http.post('/api/room/add', params, {
    custom: {
        auth: true
    }
})

//更新房源信息
export const updateRoom = (params, config = {}) => http.post('/api/room/update', params, {
    custom: {
        auth: true
    }
})
//下架房源
export const offline = (params, config = {}) => http.put('/api/room/offline', params, {
    custom: {
        auth: true
    }
})

